package com.sevenGroup.pawnshop.Utils;

import org.json.JSONObject;

import java.util.HashMap;
import java.util.List;
/*
    把java对象转为json字符串
    key是json字符串的key
    list为一个对象集合
 */
public class GetJson {
    public  static String getListJson(String key, List list){
        if (list==null) return "";
        HashMap<String,List> hss = new HashMap<String,List>();
        hss.put(key,list);
        return JSONObject.valueToString(hss);
    }
}
